package util;


import java.util.Map;
import java.util.TreeMap;

public class CustomerStorage {
    private static Map<String, Customer> customers;
    private static Customer loginCustomer;

    static {
        customers = new TreeMap<String, Customer>();
        add(new Customer("111-1111", "davpp", "123", "tw.davpp@gmail.com", "15114851714"));
    }


    public static void add(Customer customer) {
        customers.put(customer.getLibraryNumber(), customer);
    }

    public static Customer get(String libraryNumber) {
        return customers.get(libraryNumber);
    }

    public static Customer getLoginCustomer() {
        return loginCustomer;
    }

    public static void setLoginCustomer(Customer loginCustomer) {
        CustomerStorage.loginCustomer = loginCustomer;
    }
}
